<!DOCTYPE html>
<html lang="en" style="height:100%">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>买入完成</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css" />
    <link rel="stylesheet" type="text/css" href="../../css/vant.css" />
    <!-- <link rel="stylesheet" href="../../css/sqc.css"> -->
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        input{
            outline:none;
        }

    </style>
</head>

<body style="background: #fff;">
<div id="blank" class="header" v-cloak>
    <div v-back.tapmode class="back"></div>
    <span class="title">{{api.pageParam.status == 1 ? '买入完成' : '卖出完成'}}</span>
</div>
<div id="app" style="padding-top: 55px;"  v-cloak>
    <div class="purchase-order obligation">
        <div class="sell-content-top">
            <div class="details">
                <div>
                  <img class="sell-top-img" v-src="'../../image/arrow.png'"/>
                  <span style="vertical-align: middle;display: inline-block;">预计获得{{finish_con.orderType == 1 ? 'QHR' : 'CNY'}}</span>
                </div>
                <div>
                  <img class="sell-top-img" v-src="'../../image/arrow-2.png'"/>
                  <span style="vertical-align: middle;display: inline-block;">预计支出 {{finish_con.orderType == 1 ? 'CNY' : 'QHR(含手续费)'}}</span>
                </div>
            </div>
            <div class="details-bottom">
                <div>{{finish_con.orderType == 1 ? finish_con.tradeNum : finish_con.totalPrice}}</div>
                <div>{{finish_con.orderType == 1 ? finish_con.totalPrice :  finish_con.tradeNum}}</div>
            </div>
        </div>

        <div class="pur-content voucher">
            <div class="tran-content">
                <div class="seller-number-title tips-pay" style="margin-bottom: 20px">
                    <div class="tips-pay-left">
                        <p class="seller-letter">
                            {{finish_con.orderType == 1? hide_name_two(finish_con.buyNickname) : hide_name_two(finish_con.sellNickname)}}
                        </p>
                        <p class="seller-name">{{finish_con.orderType == 1? hide_name(finish_con.buyNickname) : hide_name(finish_con.sellNickname)}}</p>
                    </div>

                </div>
                <div class="detail-title">
                    <div class="unit-price-color">单价</div>
                    <div> {{finish_con.tradeNum}}CNY</div>
                </div>
                <div class="detail-title" v-if="finish_con.orderType == 2">
                    <div class="unit-price-color">手续费</div>
                    <div> {{finish_con.serviceCharge}}% QHR</div>
                </div>
                <div class="detail-title">
                    <div class="unit-price-color">锁定时间</div>
                    <div>{{finish_con.createTime}}</div>
                </div>
                <div class="detail-title">
                    <div class="unit-price-color">付款时间</div>
                    <div>{{finish_con.payTime}}</div>
                </div>
                <div class="detail-title">
                    <div class="unit-price-color">完成时间</div>
                    <div>{{finish_con.updateTime}}</div>
                </div>
                <div class="detail-title">
                    <div class="unit-price-color">订单号</div>
                    <div>{{finish_con.orderNo}}</div>
                </div>
            </div>

            <div class="pic-alipay pic-alipay-two">
              <img :src="finish_con.pictureAds" style="width:100%;object-fit: cover;vertical-align: middle">
            </div>
            <div class="confirm-pay" style="margin-bottom:20px;" v-open-win vurl="../user/myassets" v-if="finish_con.orderType == 1">我的资产</div>
            <div class="pro-complaint" style="margin-bottom:20px;" v-show="finish_con.orderType == 2" v-open-win="{orderNo:finish_con.orderNo,sellstatus:api.pageParam.status}" vurl="sellappeal">问题申诉</div>
            <!-- v-open-win="{orderNo:finish_con.orderNo,sellstatus:api.pageParam.status}" vurl="sellappeal" -->
        </div>
    </div>
</div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/components.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>
<script type="text/javascript" src="../../script/vant.min.js"></script>

<script>
    var vm,
        wx,
        finish_list,
        finish_con;
    apiready = function () {
        setBSImg();
        new Vue({
            el: '#blank'
        })
        var details={
          agtVer:1,
          clientVer:1,
          ctime:201911071802959,
          cctime:201911071802959,
          sign:"abcdefg",
          token:getPrefs('token'),
          orderNo:api.pageParam.orderid,
          orderType:api.pageParam.status,
        }
        var base = new Base64();
        var	item=base.encode(JSON.stringify(details))
        var data = {
            jsonData:item,
        };
        var callback=function(ret){
          var base = new Base64();
          var finish_list = base.decode(ret.content.jsonData);
              finish_list =JSON.parse( finish_list);
              finish_con = finish_list.coOrder;
              console.log(JSON.stringify(finish_list));
              initApp();
        }
        pinet.post(APIURLP+'/play/od/getFinishInfoData',data, callback);
        api.parseTapmode();

    };

    function initApp() {
        // var isBigImg = Vue.BSImg == 'big';
        vm = new Vue({
            el: '#app',
            data: {
              finish_list:finish_list,
              finish_con:finish_con,
              statustype:api.pageParam.status,
            },
            computed: {
            },
            methods: {
                suspend:function(){
                  api.toast({
                      msg: '暂未开放',
                      duration: 2000,
                      location: 'bottom'
                  });

                },
              hide_name_two:function(name){
                return new Array(name.length).join('') + name.substr(-1);
              },
              hide_name:function(name){
                return new Array(name.length).join('*') + name.substr(-1);
              },
            },
            watch: {

            },
        })
    }

</script>

</html>
